home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 33
/
Volume 33 - JOGO DISK .iso
/
Games
/
pin_ball_deluxe.swf
/
scripts
/
DefineSprite_426
/
frame_1
/
DoAction_2.as
next >
Wrap
Text File
|
2007-01-15
|
9KB
|
262 lines
function findPossibleSegmentTarget()
{
antSeg = segmentT;
_root.ball2rightBumper = false;
_root.ball2leftBumper = false;
_root.ball2rightTargetBlock = false;
_root.ball2leftTargetBlock = false;
_root.ball2rightFlipper = false;
_root.ball2leftFlipper = false;
_root.ball2rightRamp2 = false;
_root.ball2leftRamp2 = false;
_root.ball2rightRamp1 = false;
_root.ball2leftRamp1 = false;
tempSegments = new Array();
if(_root.ball2rightBumper != true && _root.ball2leftBumper != true && _root.ball2rightTargetBlock != true && _root.ball2leftTargetBlock != true && _root.ball2rightFlipper != true && _root.ball2leftFlipper != true && _root.ball2rightRamp2 != true && _root.ball2leftRamp2 != true && _root.ball2rightRamp1 != true && _root.ball2leftRamp1 != true)
{
for(var _loc5_ in _root.ball2splitSegment1)
{
if(_root.ball2splitSegment1[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.ball2splitSegment1[_loc5_];
}
}
}
if(this._x > _root.tbRLine._x)
{
for(_loc5_ in _root.splitSegment6)
{
if(_root.splitSegment6[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment6[_loc5_];
}
}
}
if(this._y < _root.topBLine._y)
{
for(_loc5_ in _root.splitSegment4)
{
if(_root.splitSegment4[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment4[_loc5_];
}
}
for(_loc5_ in _root.splitSegment5)
{
if(_root.splitSegment5[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment5[_loc5_];
}
}
}
if(this._y > _root.ramp2T._y)
{
if(this._y < _root.ramp2B._y)
{
if(this._x > _root.ramp2L1._x)
{
if(this._x < _root.ramp2L2._x)
{
_root.ball2leftRamp2 = true;
for(_loc5_ in _root.splitSegment7)
{
if(_root.splitSegment7[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment7[_loc5_];
}
}
for(_loc5_ in _root.ball2splitSegment11)
{
if(_root.ball2splitSegment11[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.ball2splitSegment11[_loc5_];
}
}
for(_loc5_ in _root.splitSegment17)
{
if(_root.splitSegment17[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment17[_loc5_];
}
}
}
}
if(this._x > _root.ramp2R2._x)
{
if(this._x < _root.ramp2R1._x)
{
_root.ball2rightRamp2 = true;
for(_loc5_ in _root.splitSegment9)
{
if(_root.splitSegment9[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment9[_loc5_];
}
}
for(_loc5_ in _root.ball2splitSegment12)
{
if(_root.ball2splitSegment12[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.ball2splitSegment12[_loc5_];
}
}
}
}
}
}
if(this._y > _root.ramp1T._y)
{
if(this._y < _root.ramp1B._y)
{
if(this._x > _root.ramp1L1._x)
{
if(this._x < _root.ramp1L2._x)
{
_root.ball2leftRamp1 = true;
for(_loc5_ in _root.splitSegment8)
{
if(_root.splitSegment8[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment8[_loc5_];
}
}
}
}
if(this._x > _root.ramp1R2._x)
{
if(this._x < _root.ramp1R1._x)
{
_root.ball2rightRamp1 = true;
for(_loc5_ in _root.ball2splitSegment10)
{
if(_root.ball2splitSegment10[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.ball2splitSegment10[_loc5_];
}
}
}
}
}
}
if(this._y > _root.frTLine._y)
{
if(this._y < _root.frBLine._y)
{
if(this._x > _root.frLLine1._x)
{
if(this._x < _root.frLLine2._x)
{
_root.ball2leftFlipper = true;
for(_loc5_ in _root.ball2splitSegment16)
{
if(_root.ball2splitSegment16[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.ball2splitSegment16[_loc5_];
}
}
}
}
if(this._x > _root.frRLine2._x)
{
if(this._x < _root.frRLine1._x)
{
_root.ball2rightFlipper = true;
for(_loc5_ in _root.ball2splitSegment15)
{
if(_root.ball2splitSegment15[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.ball2splitSegment15[_loc5_];
}
}
}
}
}
}
if(this._y > _root.brTLine._y)
{
if(this._y < _root.brBLine._y)
{
if(this._x > _root.brLLine1._x)
{
if(this._x < _root.brLLine2._x)
{
_root.ball2leftBumper = true;
for(_loc5_ in _root.splitSegment2)
{
if(_root.splitSegment2[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment2[_loc5_];
}
}
}
}
if(this._x > _root.brRLine2._x)
{
if(this._x < _root.brRLine1._x)
{
_root.ball2rightBumper = true;
for(_loc5_ in _root.splitSegment3)
{
if(_root.splitSegment3[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment3[_loc5_];
}
}
}
}
}
}
if(this._y > _root.tbTLine._y)
{
if(this._y < _root.tbBLine._y)
{
if(this._x > _root.tbRLine._x)
{
_root.ball2rightTargetBlock = true;
for(_loc5_ in _root.ball2splitSegment13)
{
if(_root.ball2splitSegment13[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.ball2splitSegment13[_loc5_];
}
}
}
else if(this._x < _root.tbLLine._x)
{
_root.ball2leftTargetBlock = true;
for(_loc5_ in _root.ball2splitSegment14)
{
if(_root.ball2splitSegment14[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.ball2splitSegment14[_loc5_];
}
}
}
}
}
if(tempSegments.length == 1)
{
segmentT = tempSegments[0];
return undefined;
}
segMinDistance = 100000;
var _loc4_ = -1;
for(_loc5_ in tempSegments)
{
var _loc3_ = tempSegments[_loc5_].cachedDistance;
if(_loc3_ < segMinDistance && (_loc3_ > 0 || segmentT == tempSegments[_loc5_] || tempSegments[_loc5_].isCrossed))
{
segMinDistance = _loc3_;
_loc4_ = _loc5_;
}
}
if(_loc4_ != -1)
{
segmentT = tempSegments[_loc4_];
}
else
{
segmentT = null;
}
}